import request from '@/utils/request'

/**
 * 获取部门信息
 */
export const getDepartmentListApi = () => {
  return request({
    url: '/company/department'
  })
}

/**
 * 删除部门
 */

export const delDepartmentApi = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

/**
 * 表单提交
 */

export const addDepartmentApi = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

/**
 * 获取部门详情信息
 */
export const getDepartmentDetaileApi = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}

/**
 * 编辑部门信息
 */
export const editDepartmentApi = (data) => {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}
